<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class mail extends CI_Controller {

	public function send($data ,$message)
	{
		require_once('mail/class.phpmailer.php');
		$mail = new PHPMailer();
		$mail->IsHTML(true);
		$mail->IsSMTP();
		$mail->SMTPAuth = true; // enable SMTP authentication
		$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
		$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
		$mail->Port = 465; // set the SMTP port for the GMAIL server
		$mail->Username = "cskkuchannel@gmail.com"; // GMAIL username
		$mail->Password = "cskku;2014"; // GMAIL password
		$mail->From = "no-reply"; // "name@yourdomain.com";
		$mail->FromName = "CS Channel";  // set from Name
		$mail->Subject = "Reset your CS Channel password"; 
		$mail->Body = $message;

		$mail->AddAddress($data[0]['mem_mail']); // to Address

		$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low


		$mail->Send(); 
	}
	
	
}
